<?php

$memcache = new Memcache;
	
$memcache->connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";

$tmp_object = new stdClass;
for($i = 0; $i < 10; $i++)
{
	$tmp_object->str_attr = "attribute$i";
	$tmp_object->int_attr = $i;
	$memcache->set("key$i", $tmp_object, false, 10) or die ("Failed to save data at the server 2");
}

?>